#include <iostream>
#include <string>
using namespace std;

class A{
public :
  A(){
    cout << "this from class A\n";
  }
  class B{
  public :
    B(){
      cout << "this from class B nested in class A\n";
    }
  };
};
//
//
//
//
class TradePerson
  {
public:
    string stringA;//Khong duoc gan' gia' tri. ngay
    virtual void sayHi();
    TradePerson(){
      stringA = "String in Class TradePerson\n";
    }
  };
class Tinker : public TradePerson
  {
public:
    virtual void sayHi();
  };
class Tailor : public TradePerson
  {
public:
    virtual void sayHi();
  };
void TradePerson::sayHi()
  {
    cout<< this->stringA;
    cout <<"Just hi"<< endl;
  }
void Tinker::sayHi()
  {
    cout <<"Hi, I tinker"<< endl;
  }
void Tailor::sayHi()
  {
    cout <<"Hi, I tailor"<< endl;
  }





/*
int main()
  {
    A* a = new A();
    A::B* b = new A::B();//Dùng toán tử phạm vi "::" để truy nhập tới lớp B từ lớp chứa nó là lớp A
    //
    //
    //
    //
    TradePerson* spone = new TradePerson;//Do tat ca cac lop deu co tu khoa virtual
    TradePerson* sptwo = new Tinker;// len tinh da hinh se in ra dung phuong thuc 
    TradePerson* spthere = new Tailor;// sayHi() cua moi lop
    //
    TradePerson* pone = new TradePerson;
    Tinker* ptwo = new Tinker;
    Tailor* pthere = new Tailor;
    pone->sayHi();
    ptwo->sayHi();
    pthere->sayHi();
    //
    spone->sayHi();
    sptwo->sayHi();
    spthere->sayHi();
  }
*/